
import java.io.*;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.util.ArrayList;

public class MissFiles {
	public static void main(String[] args) {
		
		if( args.length != 3 ){
			System.out.println("cmd is 'java MissFiles.java prefix maxnum suffix : as (java MissFiles.java video_frame_ 6800 png)'");
			return;
		}
		
		String prefix = args[0];
		int maxIndex = Integer.parseInt(args[1]);
		String suffix = args[2];
		
		ArrayList<Integer> missFileIndexes = new ArrayList<Integer>();
		
		for (int i=1; i < maxIndex; i++ ){
			File file = new File(prefix + String.valueOf(i) + "." + suffix);
			if( file.exists() ){
				continue;
			} else {
				missFileIndexes.add(i);
			}
		}
		
		for(int i = 0; i < missFileIndexes.size(); i++){
            System.out.println(prefix + String.valueOf(missFileIndexes.get(i)) + "." + suffix);
        }
		
	}

	
}
